package hust.game.screen;

import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.Stage;

public class SplashScreen extends AbstractScreen {
	private Stage stage;
	public static SplashScreen instance = null;

	public static SplashScreen getInstance() {
		if (instance == null) {
			instance = new SplashScreen();
		}
		return instance;
	}
	public SplashScreen(){
		stage = new Stage();
	}
	@Override
	public void show() {
		super.show();
		game.manager.load("background/background.pack",TextureAtlas.class);
		game.manager.load("ui/ui.pack",TextureAtlas.class);
		game.manager.load("ui/menu_bar.pack", TextureAtlas.class);
	}
	
	@Override
	public Stage getStage() {
		return stage;
	}
	@Override
	public void render(float delta) {
		super.render(delta);
		System.out.println(game.manager.getProgress());
		if(game.manager.update()){
			System.out.println("Navigate to MenuScreen");
			game.setScreen(new HomeScreen());
		}
	}

}
